import { Graph } from '@antv/x6';
import { useEffect } from 'react'
import data from './data'
type Props = {}
function IvAntx6(props: Props) {

  useEffect(() => {
  
    const graph = new Graph({
      container: document.getElementById('container'),
      width: document.getElementById('container').clientWidth,
      height: document.getElementById('container').clientHeight,
      background: {
        color: '#fffbe6', // 设置画布背景颜色
      },
      grid: {
        size: 10,      // 网格大小 10px
        visible: true, // 渲染网格背景
      },
    });
    
    graph.fromJSON(data)
  }, [])
  return (
    <div style={{height:'100%'}} id="container"></div>
  )
}
export default IvAntx6